<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子模型尺寸计算</title>
    <style>
        .box1{
            width: 200px;
            height: 200px;
            background-color: pink;

            padding: 20px;
        }
        .box2{
            width: 160px;
            height: 160px;
            background-color: pink;

            padding: 20px;
        }
        .box3{
            width: 200px;
            height: 200px;
            background-color: pink;

            padding: 20px;
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <div class="box1"> div 标签 </div>
    <br>
    <div class="box2"> 通过缩小宽高解决，需要手动计算 </div>
    <br>
    <div class="box3"> 通过 box-sizing: border-box 內减模式解决，不需要手动计算</div>
</body>
</html>